<extend name="Public:main" />

<block name="cssjs"></block>

<block name="area">
<li><a href="#">转诊列表</a></li>
</block>

<block name="content">
    <div class="rightinfo">
		<div class="tools">
			<ul class="seachform" style="float:left;height: 80px">
				<form name="search_form" action="__ACTION__" method="GET">
					<li><label>患者姓名：</label><input type="text" class="scinput" name="pname" value="{$pname}" placeholder="请输入患者姓名..." /><div id="st" style="width: 350px;"></div></li>
					<li><label>病种标签：</label>
						<select class="select3 scinput" name="cateid">
							<option value="0">全部</option>
							<foreach name="category" item="vo">
								<option value="{$vo['id']}" <if condition="$where['cateid'] eq $vo['id']">selected="selected"</if>>{$vo['title']}</option>
							</foreach>
						</select>
					</li>
					<li><label>状态：</label>
						<select class="select3 scinput" name="state">
							<option value="0">全部</option>
							<foreach name="statelist" item="vo">
								<option value="{$vo['id']}" <if condition="$where['state'] eq $vo['id']">selected="selected"</if>>{$vo['title']}</option>
							</foreach>
						</select>
					</li>
					<li><label><input name="type" type="radio" value="1"<?php if($type==1){echo ' checked';}?>/>开始日期：</label><input type="text" class="scinput" name="timestart" id="starttime" value="{$timestart}" placeholder="请输入开始日期..." /><div id="st" style="width: 300px;"></div></li>
					<li><label>结束日期：</label><input type="text" class="scinput" name="timeend" id="endtime" value="{$timeend}" placeholder="请输入结束日期..." /><div id="et" style="width: 350px;"></div></li>
					<li><input name="type" type="radio" value="2"<?php if($type==2){echo ' checked';}?>/>
						<label>时间段：</label>
						<select class="select3 scinput" name="time">
							<option value="5"<?php if($time==5){echo ' selected';}?>>全年</option>
							<option value="1"<?php if($time==1){echo ' selected';}?>>第1季度</option>
							<option value="2"<?php if($time==2){echo ' selected';}?>>第2季度</option>
							<option value="3"<?php if($time==3){echo ' selected';}?>>第3季度</option>
							<option value="4"<?php if($time==4){echo ' selected';}?>>第4季度</option>
							<option value="6"<?php if($time==6){echo ' selected';}?>>1-6月</option>
							<option value="7"<?php if($time==7){echo ' selected';}?>>7-12月</option>
						</select>
					</li>
					<li><label>&nbsp;</label><input type="submit" value="搜索" class="scbtn" /></li>
				</form>
			</ul>
		</div>
		<table class="imgtable">
			<thead>
				<tr>
					<th>ID</th>
					<th>患者姓名</th>
					<th>疾病类别</th>
					<th>来源医院</th>
					<th>现在所属医院</th>
					<th>转诊时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<if condition="$list neq null">
					<foreach item="listrow" name="list">
						<tr style="height:32px">
							<td>{$listrow.id}</td>
							<td>{$listrow.pname}</td>
							<td>{$listrow.cateid|jbname}</td>
							<td>{$listrow.hospital_pre|hospital_pre}</td>
							<td>{$listrow.hospital_now|hospital_now}</td>
							<td>{$listrow.addtime}</td>
							<td>{$listrow.state|state}</td>
							<td>
								<p>
									<a href="__CONTROLLER__/referraldetail/id/{$listrow.id}">详情</a>&nbsp;&nbsp;
									<!--<a href="__CONTROLLER__/patientmod/id/{$listrow.id}">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
								<a href="__CONTROLLER__/patientdel/id/{$listrow.id}" onclick="if (confirm('确定要删除吗？')) return true; else return false;">删除</a></p>
							</td>
						</tr>
					</foreach>
				<else />
					<tr style="height:32px"><td colspan="9">暂无记录！</td></tr>
				</if>
			</tbody>
		</table>
		<div class="yellow">{$pageshow}</div>
    </div>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery2.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/calendar.js"></script>
<script type="text/javascript">
    $('#st').calendar({
        trigger: '#starttime',
        zIndex: 999,
        format: 'yyyy-mm-dd',
        onSelected: function (view, date, data) {
            console.log('event: onSelected')
        },
        onClose: function (view, date, data) {
            console.log('event: onClose')
            console.log('view:' + view)
            console.log('date:' + date)
            console.log('data:' + (data || 'None'));
        }
    });
    $('#et').calendar({
        trigger: '#endtime',
        zIndex: 999,
        format: 'yyyy-mm-dd',
        onSelected: function (view, date, data) {
            console.log('event: onSelected')
        },
        onClose: function (view, date, data) {
            console.log('event: onClose')
            console.log('view:' + view)
            console.log('date:' + date)
            console.log('data:' + (data || 'None'));
        }
    });
$('.imgtable tbody tr:odd').addClass('odd');
</script>
</block>